#pragma once

#include "screen-bitmap.h"

typedef struct
{
	int x;
	int y;
	int w;
	int h;
}rect_t;

class ImageBlock
{
public:
	ImageBlock(int count, int width_, int high_);
	~ImageBlock();
	int get_rgb(color_t** rgb_tmp);

private:
	int led_count;
	int pixel_len;
	int width;
	int high;
	rect_t* block;
	int block_cnt;
	int pixel_interval;
	color_t* rgb;
	ScreenBitmap bitmap;

	void partitioning(void);
	int get_width(int move_y);
	int get_high(int move_x);
	void get_block_cnt_max_color(rect_t* pos, color_t* rgb);
};
